/*
 * Created by SharpDevelop.
 * User: David
 * Date: 2006-12-25
 * Time: 03:36
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;

namespace Labb4.Pooman.Cards
{
	/// <summary>
	/// The trump.
	/// </summary>
	public class Trump
	{
		#region members
		
		/// <summary>
		/// True if the trump has been set, otherwise false
		/// </summary>
		private bool			m_TrumpSet;
		/// <summary>
		/// The suit if the trump, if set
		/// </summary>
		private Card.Suit		m_TrumpSuit;
		
		#endregion
		
		#region constructors
		
		/// <summary>
		/// Constructor, initializes members
		/// </summary>
		public Trump()
		{
			ResetTrump();
		}
		
		#endregion
		
		#region methods
		
		/// <summary>
		/// Sets the trump to a given suit
		/// </summary>
		/// <param name="card">The card to set the trump to</param>
		public void SetTrump(Card card)
		{
			if(card != null)
			{
				m_TrumpSet = true;
				m_TrumpSuit = card.SuitOfCard;
			}
		}
		
		/// <summary>
		/// Sets the trump to a given suit
		/// </summary>
		/// <param name="suit">The suit to set the trump to</param>
		public void SetTrump(Card.Suit suit)
		{
			m_TrumpSet = true;
			m_TrumpSuit = suit;
		}
		
		/// <summary>
		/// Resets the members to initial values
		/// </summary>
		public void ResetTrump()
		{
			m_TrumpSet = false;
			m_TrumpSuit = 0;
		}
		
		#endregion
		
		#region properties
		
		/// <summary>
		/// Determines if the trump has been set or not (get)
		/// </summary>
		public bool TrumpSet
		{
			get
			{
				return m_TrumpSet;
			}
		}
		
		/// <summary>
		/// The suit of the current trump (get)
		/// </summary>
		public Card.Suit TrumpSuit
		{
			get
			{
				return m_TrumpSuit;
			}
		}
		
		#endregion
	}
}
